package com.sasis.dao.ibatis;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.sasis.dao.RoleHandlePermissionDao;
import com.sasis.model.RoleHandlePermission;

public class RoleHandlePermissionDaoIbatisImpl extends BaseDaoIbatisImpl implements RoleHandlePermissionDao {

	public RoleHandlePermissionDaoIbatisImpl() {
		super(RoleHandlePermission.class);
	}

	public RoleHandlePermission loadByPermission(Long roleId, Long handleId) {
		Map params = new HashMap();
		params.put("roleId", roleId);
		params.put("handleId", handleId);
		return (RoleHandlePermission) getSqlMapClientWrapper().queryForObject("loadByPermission", params);
	}
	
	public Collection findByAllow(Long roleId) {
		return getSqlMapClientWrapper().queryForList("findByAllow", roleId);
	}
}
